#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

bool check(long long x) {
    while (x != 1) {
        if (x % 2 == 0) x /= 2;
        else return false;
    }
    return true;
}

class Solution {
public:
    int longestCommonSubsequence(string text1, string text2) {
        int m = text1.size(), n = text2.size();
        vector<vector<int>> dp(m + 1, vector<int>(n + 1));
        for (int i = 1; i <= m; ++i) {
            for (int j = 1; j <= n; ++j) {
                if (text1[i - 1] == text2[j - 1]) {
                    dp[i][j] = dp[i - 1][j - 1] + 1;
                }
                else {
                    dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
                }
            }
        }
        return dp[m][n];
    }

    int maxUncrossedLines(vector<int>& nums1, vector<int>& nums2) {
        int m = nums1.size(), n = nums2.size();
        vector<vector<int>> dp(m + 1, vector<int>(n + 1));
        for (int i = 1; i <= m; ++i) {
            for (int j = 1; j <= n; ++j) {
                if (nums1[i - 1] == nums2[j - 1]) {
                    dp[i][j] = dp[i - 1][j - 1] + 1;
                }
                else {
                    dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
                }
            }
        }
        return dp[m][n];
    }

    string manacherString(string s) {
        string ret;
        int index = 0;
        for (int i = 0; i <= 2 * s.size(); ++i) {
            ret += (i & 1) ? s[index++] : '#';
        }
        return ret;
    }

    int manacher(string s) {
        if (s == "") return 0;
        string ms = manacherString(s);
        int n = ms.size();
        int R = 0;
        int c = 0;
        vector<int> pArr(n);
        int ret = 1;
        for (int i = 0; i < ms.size(); ++i) {
            pArr[i] = R > i ? min(pArr[2 * c - i] , R-i):1;

            while (i + pArr[i] < n && i - pArr[i] >= 0) {
                if (ms[i + pArr[i]] == ms[i - pArr[i]]) ++pArr[i];
                else break;
            }
            ret = max(ret, pArr[i]);
        }
        return ret-1;
    }
};

int main() {
    /*int n;
    cin >> n;
    int ans = 0;
    while (n--)
    {
        long long x;
        cin >> x;
        if (check(x)) {
            ++ans;
        }
    }
    cout << ans;
    return 0;*/
    Solution s;
    int n = s.manacher("bbaabcdcbaacc");
    cout << n;
    return 0;
}